home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume89 / editors / stevie36.6 < prev    next >
Internet Message Format  |  1989-05-12  |  58KB

  1. Path: xanth!indri!unmvax!ncar!ames!oliveb!sun!swap!page
  2. From: page%swap@Sun.COM (Bob Page)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v89i135:  stevie - vi editor clone v3.6, Part06/06
  5. Message-ID: <104422@sun.Eng.Sun.COM>
  6. Date: 12 May 89 03:07:31 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 1960
  9. Approved: page@sun.com
  10.  
  11. Submitted-by: grwalter@watmath.waterloo.edu (Fred Walter)
  12. Posting-number: Volume 89, Issue 135
  13. Archive-name: editors/stevie36.6
  14.  
  15. # This is a shell archive.
  16. # Remove anything above and including the cut line.
  17. # Then run the rest of the file through 'sh'.
  18. # Unpacked files will be owned by you and have default permissions.
  19. #----cut here-----cut here-----cut here-----cut here----#
  20. #!/bin/sh
  21. # shar: SHell ARchive
  22. # Run the following text through 'sh' to create:
  23. #    source.doc
  24. #    stevie.doc
  25. #    stevie.h
  26. #    tags
  27. #    term.h
  28. #    tos.c
  29. #    tos.h
  30. #    unix.c
  31. #    unix.h
  32. #    version.c
  33. # This is archive 6 of a 6-part kit.
  34. # This archive created: Thu May 11 19:41:29 1989
  35. echo "extracting source.doc"
  36. sed 's/^X//' << \SHAR_EOF > source.doc
  37. X
  38. X         Release Notes for STEVIE - Version 3.10a
  39. X
  40. X                  Source Notes
  41. X
  42. X              Tony Andrews - March 6, 1988
  43. X
  44. XOverview
  45. X--------
  46. X
  47. X    This file provides a brief description of the source code for
  48. XStevie. The data structures are described later as well. For information
  49. Xspecific to porting the editor, see the file 'porting.doc'. This document
  50. Xis more relevant to people who want to hack on the editor apart from doing
  51. Xa simple port.
  52. X
  53. X    Most of this document was written some time ago so a lot of the
  54. Xdiscussion centers on problems related to the Atari ST environment and
  55. Xcompilers. Most of this can be ignored for other systems.
  56. X
  57. XThings You Need - ATARI
  58. X-----------------------
  59. X
  60. X    Stevie has been compiled with both the Alcyon (4.14A) and the
  61. XMegamax C compilers. For the posted binary, Megamax was used because
  62. Xit's less buggy and provides a reasonable malloc(). Ports to other
  63. Xcompilers should be pretty simple. The current ifdef's for ALCYON and
  64. XMEGAMAX should point to the potential trouble areas. (See 'porting.doc'
  65. Xfor more information.)
  66. X
  67. X    The search code depends on Henry Spencer's regular expression
  68. Xcode. I used a version I got from the net recently (as part of a 'grep'
  69. Xposting) and had absolutely no trouble compiling it on the ST. Thanks,
  70. XHenry!
  71. X
  72. X    The file 'getenv.c' contains a getenv routine that may or may
  73. Xnot be needed with your compiler. My version works with Alcyon and
  74. XMegamax, under either the Beckemeyer or Gulam shells.
  75. X
  76. X    Lastly, you need a decent malloc. Lots of stuff in stevie is
  77. Xallocated dynamically. The malloc with Alcyon is problematic because
  78. Xit allocates from the heap between the end of data and the top of stack.
  79. XIf you make the stack big enough to edit large files, you wind up
  80. Xwasting space when working with small files. Mallocs that get their memory
  81. Xfrom GEMDOS (in fairly large chunks) are much better.
  82. X
  83. XThings You Need - AMIGA
  84. X-----------------------
  85. X
  86. X    Lattice C version 5.0 or later.
  87. X
  88. XData Structures
  89. X---------------
  90. X
  91. X    A brief discussion of the evolution of the data structures will
  92. Xdo much to clarify the code, and explain some of the strangeness you may
  93. Xsee.
  94. X
  95. X    In the original version, the file was maintained in memory as a
  96. Xsimple contiguous buffer. References to positions in the file were simply
  97. Xcharacter pointers. Due to the obvious performance problems inherent in
  98. Xthis approach, the following changes were made.
  99. X
  100. X    The file is now represented by a doubly linked list of 'line'
  101. Xstructures defined as follows:
  102. X
  103. Xstruct    line {
  104. X    struct    line   *next;    /* next line */
  105. X    struct    line   *prev;    /* previous line */
  106. X    char           *s;    /* text for this line */
  107. X    int            size;    /* actual size of space at 's' */
  108. X    unsigned long   num;    /* line "number" */
  109. X};
  110. X
  111. XThe members of the line structure are described more completely here:
  112. X
  113. Xprev    - pointer to the structure for the prior line, or NULL for the
  114. X      first line of the file
  115. X
  116. Xnext    - like 'prev' but points to the next line
  117. X
  118. Xs    - points to the contents of the line (null terminated)
  119. X
  120. Xsize    - contains the size of the chunk of space pointed to by s. This
  121. X      is used so we know when we can add text to a line without getting
  122. X      more space. When we DO need more space, we always get a little
  123. X      extra so we don't make so many calls to malloc.
  124. X
  125. Xnum    - This is a pseudo line number that makes it easy to compare
  126. X      positions within the file. Otherwise, we'd have to traverse
  127. X      all the links to tell which line came first.
  128. X
  129. X    Since character pointers served to mark file positions in the
  130. Xoriginal, a similar data object was needed for the new data structures.
  131. XThis purpose is served by the 'lptr' structure which is defined as:
  132. X
  133. Xstruct    lptr {
  134. X    struct    line   *linep;    /* line we're referencing */
  135. X    int             index;    /* position within that line */
  136. X};
  137. X
  138. XThe member 'linep' points to the 'line' structure for the line containing
  139. Xthe location of interest. The integer 'index' is the offset into the line
  140. Xdata (member 's') of the character to be referenced.
  141. X
  142. XThe following typedef's are more commonly used:
  143. X
  144. Xtypedef    struct line    LINE;
  145. Xtypedef    struct lptr    LPtr;
  146. X
  147. XMany operations that were trivial with character pointers had to be
  148. Ximplemented by functions or macros to manipulate LPtr's. Most of these are in
  149. Xthe files 'ptrfunc.c' and 'macros.h'. There you'll find functions to increment,
  150. Xdecrement, and compare LPtr's.
  151. SHAR_EOF
  152. echo "extracting stevie.doc"
  153. sed 's/^X//' << \SHAR_EOF > stevie.doc
  154. X
  155. X        STEVIE - Simply Try this Editor for VI Enthusiasts
  156. X
  157. X             Quick Reference Card
  158. X
  159. X                  by
  160. X
  161. X              Tony Andrews And G. R. (Fred) Walter
  162. X
  163. XSTEVIE may be freely distributed. The source isn't copyrighted or
  164. Xrestricted in any way. If you pass the program along, please include all
  165. Xthe documentation and, if practical, the source as well.
  166. X
  167. XSTEVIE used to stand for 'ST Editor for VI Enthusiasts', however since this
  168. Xeditor is used on more machines than just ST's the acronym was changed.
  169. X
  170. XStarting the Editor
  171. X-------------------
  172. X
  173. XThe following command line forms are supported:
  174. X
  175. X    vi [file ...]        Edit the specified file(s)
  176. X
  177. X    vi -t tag        Start at location of the given tag
  178. X
  179. X    vi + file        Edit file starting at end
  180. X
  181. X    vi +n file        Edit file starting a line number 'n'
  182. X
  183. X    vi +/pat file        Edit file starting at pattern 'pat'
  184. X
  185. XIf multiple files are given on the command line (using the first form),
  186. Xthe ":n" command goes to the next file, ":p" goes backward in the list,
  187. Xand ":rew" can be used to rewind back to the start of the file list.
  188. X
  189. XSet Command Options
  190. X-------------------
  191. X
  192. XThe ":set" command works as usual to set parameters. Each parameter has
  193. Xa long and an abbreviated name, either of which may be used. Boolean
  194. Xparameters are set as in:
  195. X
  196. X    set showmatch
  197. X
  198. Xor cleared by:
  199. X
  200. X    set noshowmatch
  201. X
  202. XNumeric parameters are set as in:
  203. X
  204. X    set scroll=5
  205. X
  206. XSeveral parameters may be set with a single command:
  207. X
  208. X    set novb sm report=1
  209. X
  210. XTo see the status of all parameters use ":set all". Typing ":set" with
  211. Xno arguments will show only those parameters that have been changed.
  212. XThe supported parameters, their names, defaults, and descriptions are
  213. Xshown below:
  214. X
  215. XFull Name    Short    Default        Description
  216. X------------------------------------------------------------------------------
  217. Xvbell        vb    vb        Use visual bell (novb for audible bell)
  218. Xshowmatch    sm    nosm        Showmatch mode
  219. Xwrapscan    ws    ws        Wrapscan (searches cross file start/end)
  220. Xerrorbells    eb    noeb        Ring bell when error messages are shown
  221. Xshowmode    mo    nomo        Show on status line when in insert mode
  222. Xbackup        bk    nobk        Leave backup in *.bak on file writes
  223. Xreturn        cr    cr        End lines with cr-lf when writing
  224. Xlist        list    nolist        Show tabs and newlines graphically
  225. Xautoindent      ai      noai            Start new line at same col as prior line
  226. Xignorecase      ic      noic            Ignore case in search strings
  227. Xnumber          nu      nonu            Display lines with their line numbers
  228. X
  229. Xscroll        scroll    12        Number of lines to scroll for ^D and ^U
  230. Xtabstop        ts    8        Number of spaces in a tab
  231. Xreport        report    5        Min # of lines to report operations on
  232. Xlines        lines    25        Number of lines on the screen
  233. X
  234. XThe EXINIT environment variable can be used to modify the default values
  235. Xon startup as in:
  236. X
  237. X        setenv EXINIT="set sm ts=4"
  238. X
  239. XThe 'backup' parameter, if set, causes the editor to retain a backup of any
  240. Xfiles that are written. During file writes, a backup is always kept for
  241. Xsafety until the write is completed. At that point, the 'backup' parameter
  242. Xdetermines whether the backup file is deleted.
  243. X
  244. XIn environments (e.g. OS/2 or TOS) where lines are normally terminated by
  245. XCR-LF, the 'return' parameter allows files to be written with only a LF
  246. Xterminator (if the parameter is cleared).
  247. X
  248. XThe 'lines' parameter tells the editor how many lines there are on the screen.
  249. XThis is useful on systems like the ST where various screen resolutions may be
  250. Xused. By using the 'lines' parameter, different screen sizes can be easily
  251. Xhandled. On the Amiga system window resizes are atomatically detected and
  252. Xacted upon. It is suggested that one's window be larger than 2 rows and 5
  253. Xcolumns.
  254. X
  255. XColon Commands
  256. X--------------
  257. X
  258. XSeveral of the normal 'vi' colon commands are supported by STEVIE. Some commands
  259. Xmay be preceded by a line range specification. For commands that accept a range
  260. Xof lines, the following address forms are supported:
  261. X
  262. Xaddr
  263. Xaddr + number
  264. Xaddr - number
  265. X
  266. Xwhere 'addr' may be one of the following:
  267. X    a line number
  268. X    a mark (as in 'a or 'b)
  269. X    % (entire file)
  270. X    . (the current line)
  271. X    $ (the last line)
  272. X
  273. XThe Global Command
  274. X------------------
  275. X
  276. XA limited form of the global command is supported, accepting the following
  277. Xcommand form:
  278. X
  279. Xg/pattern/X
  280. X
  281. Xwhere X may be either 'd' or 'p' to delete or print lines that match the given
  282. Xpattern. If a line range is given, only those lines are checked for a match
  283. Xwith the pattern. If no range is given, all lines are checked.
  284. X
  285. XIf the trailing command character is omitted, 'p' is assumed. In this case, the
  286. Xtrailing slash is also optional. The current version of the editor does not
  287. Xsupport the undo operation following the deletion of lines with the global
  288. Xcommand.
  289. X
  290. XThe Substitute Command
  291. X----------------------
  292. X
  293. XThe substitute command provides a powerful mechanism for making more complex
  294. Xsubstitutions than can be done directly from visual mode. The general form of
  295. Xthe command is:
  296. X
  297. Xs/pattern/replacement/g
  298. X
  299. XEach line in the given range (or the current line, if no range was given) is
  300. Xscanned for the given regular expression. When found, the string that matched
  301. Xthe pattern is replaced with the given replacement string. If the replacement
  302. Xstring is null, each matching pattern string is deleted.
  303. X
  304. XThe trailing 'g' is optional and, if present, indicates that multiple
  305. Xoccurrences of 'pattern' on a line should all be replaced.
  306. X
  307. XSome special sequences are recognized in the replacement string. The
  308. Xampersand character is replaced by the entire pattern that was matched.
  309. XFor example, the following command could be used to put all occurrences
  310. Xof 'foo' or 'bar' within double quotes:
  311. X
  312. X1,$s/foo|bar/&/g
  313. X
  314. XThe special sequence "\n" where 'n' is a digit from 1 to 9, is replaced
  315. Xby the string the matched the corresponding parenthesized expression in
  316. Xthe pattern. The following command could be used to swap the first two
  317. Xparameters in calls to the C function "foo":
  318. X
  319. X1,$s/foo\\(([^,]*),([^,]*),/foo(\\2,\\1,/g
  320. X
  321. XLike the global command, substitutions can't be undone with this version of
  322. Xthe editor.
  323. X
  324. XThe Delete Command
  325. X------------------
  326. X
  327. X:[range]d will delete the range of lines.
  328. X
  329. XFile Manipulation Commands
  330. X--------------------------
  331. X
  332. X:w        write the current file
  333. X:wq        write and quit
  334. X:x        write (if necessary) and quit
  335. XZZ        same as ":x"
  336. X
  337. X:e file        edit the named file
  338. X:e!        re-edit the current file, discarding any changes
  339. X:e #        edit the alternate file
  340. X
  341. X:w file        write the buffer to the named file
  342. X:x,y w file    write lines x through y to the named file
  343. X:r file        read the named file into the buffer
  344. X
  345. X:n        edit the next file
  346. X:p        edit the previous file
  347. X:rew        rewind the file list
  348. X
  349. X:f        show the current file name
  350. X:f name        change the current file name
  351. X
  352. X:ta tag        go to the named tag
  353. X^]        like ":ta" using the current word as the tag
  354. X
  355. X:help        display a command summary
  356. X
  357. XThe ":help" command can also be invoke with the <HELP> key on the Atari ST
  358. Xor the Amiga. This actually displays a pretty complete summary of the real vi
  359. Xwith unsupported features indicated appropriately.
  360. X
  361. XThe commands above work pretty much like they do in 'vi'. Most of the
  362. Xcommands support a '!' suffix (if appropriate) to discard any pending
  363. Xchanges.
  364. X
  365. XString Searches
  366. X---------------
  367. X
  368. XString searches are supported, as in vi, accepting the usual regular
  369. Xexpression syntax. This was done using Henry Spencer's regular expression
  370. Xlibrary without modification. Tony Andrews added code outside the library to
  371. Xsupport the '\<' and '\>' extensions and code inside the library to support
  372. Xthe ignorecase option.
  373. X
  374. XOperators
  375. X---------
  376. X
  377. XThe vi operators (d, c, y, <, and >) work as true operators.
  378. X
  379. XTags
  380. X----
  381. X
  382. XTags are implemented.
  383. X
  384. XSystem-Specific Comments
  385. X------------------------
  386. X
  387. XThe following sections provide additional relevant information for the
  388. Xsystems to which STEVIE has been ported.
  389. X
  390. XAtari ST
  391. X--------
  392. X
  393. XThe editor has been tested in all three resolutions, although low and
  394. Xhigh res. are less tested than medium. The 50-line high res. mode can
  395. Xbe used by setting the 'lines' parameter to 50. Alternatively, the
  396. Xenvironment variable 'LINES' can be set. The editor doesn't actively
  397. Xset the number of lines on the screen. It just operates using the number
  398. Xof lines it was told.
  399. X
  400. XThe arrow keys, as well as the <INSERT>, <HELP>, and <UNDO> keys are
  401. Xall mapped appropriately.
  402. X
  403. XUNIX
  404. X----
  405. X
  406. XThe editor has been ported to UNIX System V release 3. It's hard-coded for
  407. Xansi-style escape sequences and doesn't use the termcap/terminfo routines at
  408. Xall.
  409. X
  410. XOS/2
  411. X----
  412. X
  413. XMake sure 'ansi' mode is on (using the 'ansi' command).
  414. XThe OS/2 console driver doesn't support insert/delete line, so STEVIE
  415. Xbypasses the driver and makes the appropriate system calls directly.
  416. XThis is all done in the system-specific part of the editor so the kludge
  417. Xis at least localized.
  418. X
  419. XThe arrow keys, page up/down and home/end all do what you'd expect. The function
  420. Xkeys are hard-coded to some useful macros until I can get true support for
  421. Xmacros into the editor. The current mappings are:
  422. X
  423. XF1    :p <RETURN>
  424. XF2    :n <RETURN>
  425. XF3    :e # <RETURN>
  426. XF4    :rew <RETURN>
  427. XF5    [[
  428. XF6    ]]
  429. XF7    <<
  430. XF8    >>
  431. XF9    :x <RETURN>
  432. XF10    :help <RETURN>
  433. X
  434. XS-F1    :p! <RETURN>
  435. XS-F2    :n! <RETURN>
  436. X
  437. XMSDOS
  438. X-----
  439. X
  440. XSTEVIE has been ported to MSDOS 3.3 on an AT using the Microsoft C compiler,
  441. Xversion 5.10.  The keyboard mappings are the same as for OS/2.
  442. XThe only problem with the PC version is that the inefficiency of
  443. Xthe screen update code becomes painfully apparent on slower machines.
  444. X
  445. XBSD 4.3
  446. X-------
  447. X
  448. XThis port was done so it could be worked on in a main-frame enviroment.
  449. X
  450. XAmiga
  451. X-----
  452. X
  453. XThe arrow keys and the help key are supported, as is window re-sizing.
  454. XIt is strongly suggested that you not try to type in console commands
  455. X(alt-esc in some keymaps, plus the appropriate other keys) since STEVIE
  456. Xcaptures all console input. If you do type alt-esc then typing '|' will
  457. Xreturn you to STEVIE.
  458. X
  459. XMissing Features
  460. X----------------
  461. X
  462. X1. Macros with support for function keys.
  463. X
  464. X2. More "set" options.
  465. X
  466. X3. Many others...
  467. X
  468. XKnown Bugs and Problems
  469. X-----------------------
  470. X
  471. X1. The yank buffer uses statically allocated memory, so yanks of more than
  472. X   5K of text will fail. If a delete spans more than 5K, the program asks
  473. X   for confirmation before proceeding. That way, if you were moving text,
  474. X   you don't get screwed by the limited yank buffer. You just have to move
  475. X   smaller chunks at a time. All the internal buffers (yank, redo, etc.)
  476. X   need to be reworked to allocate memory dynamically.
  477. X
  478. X2. If you stay in insert mode for a long time (around 5K's worth of
  479. X   characters, including newlines) the insert buffer can overflow.
  480. X   When this happens you lose your ability to automatically undo the text just
  481. X   inserted and the redo/undo/(undo of undo) buffers are reset to the
  482. X   current position.
  483. X
  484. X3. Several other less bothersome glitches...
  485. X
  486. XCharacter Function Summary
  487. X--------------------------
  488. X
  489. XThe following list describes the meaning of each character that's used
  490. Xby the editor. In some cases characters have meaning in both command and
  491. Xinsert mode; these are all described.
  492. X
  493. X^@    The null character. Not used in any mode. This character may not
  494. X    be present in the file, as is the case with vi.
  495. X
  496. X^B    Backward one screen.
  497. X
  498. X^D    Scroll the window down one half screen.
  499. X
  500. X^E    Scroll the screen up one line.
  501. X
  502. X^F    Forward one screen.
  503. X
  504. X^G    Same as ":f" command. Displays file information.
  505. X
  506. X^H (BS)    Moves cursor left one space in command mode. In insert mode, erases
  507. X    the last character typed.
  508. X
  509. X^J    Move the cursor down one line.
  510. X
  511. X^L    Clear and redraw the screen.
  512. X
  513. X^M (CR)    Move to the first non-white character in the next line. In insert
  514. X    mode, a carriage return opens a new line for input.
  515. X
  516. X^N    Move the cursor down a line.
  517. X
  518. X^P    Move the cursor up a line.
  519. X
  520. X^U    Scroll the window up one half screen.
  521. X
  522. X^V    Indicates that the next character is should be treated as entered
  523. X    and not modified (used to enter control characters, etc.).
  524. X
  525. X^Y    Scroll the screen down one line.
  526. X
  527. X^[    Escape cancels a pending command in command mode, and is used to
  528. X    terminate insert mode.
  529. X
  530. X^]    Moves to the tag whose name is given by the word in which the cursor
  531. X    resides.
  532. X
  533. X^`    Same as ":e #" if supported (system-dependent).
  534. X
  535. XSPACE    Move the cursor right on column.
  536. X
  537. X$    Move to the end of the current line.
  538. X
  539. X%    If the cursor rests on a paren '()', brace '{}', or bracket '[]',
  540. X    move to the matching one.
  541. X
  542. X'    Used to move the cursor to a previously marked position, as in
  543. X    'a or 'b. The cursor moves to the start of the marked line. The
  544. X    special mark '' refers to the "previous context".
  545. X
  546. X+    Same as carriage return, in command mode.
  547. X
  548. X,    Reverse of the last t, T, f, or F command.
  549. X
  550. X-    Move to the first non-white character in the previous line.
  551. X
  552. X.    Repeat the last edit command.
  553. X
  554. X/    Start of a forward string search command. String searches may be
  555. X    optionally terminated with a closing slash. To search for a slash
  556. X    use '\/' in the search string.
  557. X
  558. X0    Move to the start of the current line. Also used within counts.
  559. X
  560. X1-9    Used to add 'count' prefixes to commands.
  561. X
  562. X:    Prefix character for "ex" commands.
  563. X
  564. X;    Repeat last t, T, f, or F command.
  565. X
  566. X<    The 'left shift' operator.
  567. X
  568. X>    The 'right shift' operator.
  569. X
  570. X?    Same as '/', but search backward.
  571. X
  572. XA    Append at the end of the current line.
  573. X
  574. XB    Backward one blank-delimited word.
  575. X
  576. XC    Change the rest of the current line.
  577. X
  578. XD    Delete the rest of the current line.
  579. X
  580. XE    End of the end of a blank-delimited word.
  581. X
  582. XF    Find a character backward on the current line.
  583. X
  584. XG    Go to the given line number (end of file, by default).
  585. X
  586. XH    Move to the first non-white char. on the top screen line.
  587. X
  588. XI    Insert before the first non-white char. on the current line.
  589. X
  590. XJ    Join two lines.
  591. X
  592. XL    Move to the first non-white char. on the bottom screen line.
  593. X
  594. XM    Move to the first non-white char. on the middle screen line.
  595. X
  596. XN    Reverse the last string search.
  597. X
  598. XO    Open a new line above the current line, and start inserting.
  599. X
  600. XP    Put the yank/delete buffer before the current cursor position.
  601. X
  602. XT    Reverse search 'upto' the given character.
  603. X
  604. XW    Move forward one blank-delimited word.
  605. X
  606. XX    Delete one character before the cursor.
  607. X
  608. XY    Yank the current line. Same as 'yy'.
  609. X
  610. XZZ    Exit from the editor, saving changes if necessary.
  611. X
  612. X[[    Move backward one C function.
  613. X
  614. X]]    Move forward one C function.
  615. X
  616. X^    Move to the first non-white on the current line.
  617. X
  618. X`    Move to the given mark, as with '. The distinction between the two
  619. X    commands is important when used with operators. I support the
  620. X    difference correctly. If you don't know what I'm talking about,
  621. X    don't worry, it won't matter to you.
  622. X
  623. X~       Switch case of character under cursor.
  624. X
  625. Xa    Append text after the cursor.
  626. X
  627. Xb    Back one word.
  628. X
  629. Xc    The change operator.
  630. X
  631. Xd    The delete operator.
  632. X
  633. Xe    Move to the end of a word.
  634. X
  635. Xf    Find a character on the current line.
  636. X
  637. Xh    Move left one column.
  638. X
  639. Xi    Insert text before the cursor.
  640. X
  641. Xj    Move down one line.
  642. X
  643. Xk    Move up one line.
  644. X
  645. Xl    Move right one column.
  646. X
  647. Xm    Set a mark at the current position (e.g. ma or mb).
  648. X
  649. Xn    Repeat the last string search.
  650. X
  651. Xo    Open a new line and start inserting text.
  652. X
  653. Xp    Put the yank/delete buffer after the cursor.
  654. X
  655. Xr    Replace a character.
  656. X
  657. Xs    Replace characters.
  658. X
  659. Xt    Move forward 'upto' the given character on the current line.
  660. X
  661. Xu    Undo the last edit.
  662. X
  663. Xw    Move forward one word.
  664. X
  665. Xx    Delete the character under the cursor.
  666. X
  667. Xy    The yank operator.
  668. X
  669. Xz    Redraw the screen with the current line at the top (zRETURN),
  670. X    the middle (z.), or the bottom (z-).
  671. X
  672. X|    Move to the column given by the preceding count.
  673. SHAR_EOF
  674. echo "extracting stevie.h"
  675. sed 's/^X//' << \SHAR_EOF > stevie.h
  676. X/*
  677. X * STEVIE - Simply Try this Editor for VI Enthusiasts
  678. X *
  679. X * Code Contributions By : Tim Thompson           twitch!tjt
  680. X *                         Tony Andrews           onecom!wldrdg!tony 
  681. X *                         G. R. (Fred) Walter    watmath!watcgl!grwalter 
  682. X */
  683. X
  684. X#include "env.h"
  685. X
  686. X#include <stdio.h>
  687. X#ifndef ATARI
  688. X# ifndef UNIX
  689. X#   include <stdlib.h>
  690. X# endif
  691. X#endif
  692. X#include <ctype.h>
  693. X#ifndef MWC
  694. X# include <string.h>
  695. X#endif
  696. X#include "ascii.h"
  697. X#include "keymap.h"
  698. X#include "param.h"
  699. X#include "term.h"
  700. X#include "macros.h"
  701. X
  702. X#ifdef AMIGA
  703. X/*
  704. X * This is used to disable break signal handling.
  705. X */
  706. X#include <signal.h>
  707. X#endif
  708. X
  709. Xextern char    *strchr();
  710. X
  711. X#define NORMAL             0
  712. X#define CMDLINE             1
  713. X#define INSERT             2
  714. X#define APPEND             3
  715. X#define UNDO             4
  716. X#define REDO             5
  717. X#define PUT             6
  718. X#define FORWARD             7
  719. X#define BACKWARD         8
  720. X#define VALID             9
  721. X#define NOT_VALID        10
  722. X#define VALID_TO_CURSCHAR    11
  723. X#define UPDATE_CURSOR           12
  724. X#define UPDATE_ALL              13
  725. X
  726. X/*
  727. X * Boolean type definition and constants 
  728. X */
  729. Xtypedef int     bool_t;
  730. X
  731. X#ifndef    TRUE
  732. X# define    FALSE    (0)
  733. X# define    TRUE    (1)
  734. X#endif
  735. X#define    SORTOF    (2)
  736. X#define YES      TRUE
  737. X#define NO       FALSE
  738. X#define MAYBE    SORTOF
  739. X
  740. X/*
  741. X * Maximum screen dimensions
  742. X */
  743. X#define MAX_COLUMNS 140L
  744. X
  745. X/*
  746. X * Buffer sizes
  747. X */
  748. X#define CMDBUFFSIZE MAX_COLUMNS    /* size of the command processing buffer */
  749. X
  750. X#define LSIZE        512    /* max. size of a line in the tags file */
  751. X
  752. X#define IOSIZE     (1024+1)    /* file i/o and sprintf buffer size */
  753. X
  754. X#define YANKSIZE    5200    /* yank buffer size */
  755. X#define INSERT_SIZE 5300    /* insert, redo and undo buffer size must be
  756. X                 * bigger than YANKSIZE */
  757. X#define REDO_UNDO_SIZE 5400    /* redo, undo and (undo an undo) buffer size
  758. X                 * must be bigger than INSERT_SIZE */
  759. X#define READSIZE    5500    /* read buffer size must be bigger than
  760. X                 * YANKSIZE and REDO_UNDO_SIZE */
  761. X
  762. X/*
  763. X * SLOP is the amount of extra space we get for text on a line during editing
  764. X * operations that need more space. This keeps us from calling alloc every
  765. X * time we get a character during insert mode. No extra space is allocated
  766. X * when the file is initially read. 
  767. X */
  768. X#define    SLOP    10
  769. X
  770. X/*
  771. X * LINEINC is the gap we leave between the artificial line numbers. This
  772. X * helps to avoid renumbering all the lines every time a new line is
  773. X * inserted. 
  774. X *
  775. X * Since line numbers are stored in longs (32 bits), a LINEINC of 10000
  776. X * lets us have > 200,000 lines and we won't have to renumber very often.
  777. X */
  778. X#define    LINEINC    10000
  779. X
  780. X#define CHANGED    Changed = TRUE
  781. X#define UNCHANGED  Changed = FALSE
  782. X
  783. X#define S_NOT_VALID NumLineSizes = -1
  784. X
  785. X#define S_LINE_NOT_VALID LineNotValid = TRUE
  786. X
  787. X#define S_CHECK_TOPCHAR_AND_BOTCHAR CheckTopcharAndBotchar = TRUE
  788. X
  789. X#define S_MUST_UPDATE_BOTCHAR MustUpdateBotchar = TRUE
  790. X
  791. X#define S_VALID_TO_CURSCHAR ValidToCurschar = TRUE
  792. X
  793. Xstruct line {
  794. X    struct line    *next;    /* next line */
  795. X    struct line    *prev;    /* previous line */
  796. X    char           *s;        /* text for this line */
  797. X    int             size;    /* actual size of space at 's' */
  798. X    unsigned long   num;    /* line "number" */
  799. X};
  800. X
  801. X#define    LINEOF(x)    ((x)->linep->num)
  802. X
  803. Xstruct lptr {
  804. X    struct line    *linep;    /* line we're referencing */
  805. X    int             index;    /* position within that line */
  806. X};
  807. X
  808. Xtypedef struct line LINE;
  809. Xtypedef struct lptr LPtr;
  810. X
  811. Xstruct charinfo {
  812. X    char            ch_size;
  813. X    char           *ch_str;
  814. X};
  815. X
  816. Xextern struct charinfo chars[];
  817. X
  818. Xextern int      State;
  819. Xextern int      Rows;
  820. Xextern int      Columns;
  821. Xextern int      CheckTopcharAndBotchar;
  822. Xextern int      MustUpdateBotchar;
  823. Xextern int      ValidToCurschar;
  824. Xextern int      LineNotValid;
  825. Xextern int      NumLineSizes;
  826. Xextern LINE   **LinePointers;
  827. Xextern char    *LineSizes;
  828. Xextern char    *Filename;
  829. Xextern LPtr    *Filemem;
  830. Xextern LPtr    *Filetop;
  831. Xextern LPtr    *Fileend;
  832. Xextern LPtr    *Topchar;
  833. Xextern LPtr    *Botchar;
  834. Xextern LPtr    *Curschar;
  835. Xextern LPtr    *Insstart;
  836. Xextern int      Cursrow, Curscol, Cursvcol, Curswant;
  837. Xextern bool_t   set_want_col;
  838. Xextern int      Prenum;
  839. Xextern bool_t   Changed;
  840. Xextern bool_t   RedrawingDisabled;
  841. Xextern bool_t   UndoInProgress;
  842. Xextern bool_t   Binary;
  843. Xextern char    *IObuff;
  844. Xextern char    *Insbuffptr;
  845. Xextern char    *Insbuff;
  846. Xextern char    *Readbuffptr;
  847. Xextern char    *Readbuff;
  848. Xextern char    *Redobuffptr;
  849. Xextern char    *Redobuff;
  850. Xextern char    *Undobuffptr;
  851. Xextern char    *Undobuff;
  852. Xextern char    *UndoUndobuffptr;
  853. Xextern char    *UndoUndobuff;
  854. Xextern char    *Yankbuffptr;
  855. Xextern char    *Yankbuff;
  856. Xextern char     last_command;
  857. Xextern char     last_command_char;
  858. X
  859. Xextern char    *strcpy();
  860. X
  861. X/* alloc.c */
  862. Xchar  *alloc();
  863. Xchar  *strsave();
  864. Xvoid   screenalloc();
  865. Xvoid   filealloc();
  866. Xvoid   freeall();
  867. XLINE  *newline();
  868. Xbool_t canincrease();
  869. X
  870. X/* cmdline.c */
  871. Xvoid   readcmdline();
  872. Xvoid   dotag();
  873. Xvoid   msg();
  874. Xvoid   emsg();
  875. Xvoid   smsg();
  876. Xvoid   gotocmdline();
  877. Xvoid   wait_return();
  878. X
  879. X/* dec.c */
  880. Xint    dec();
  881. X
  882. X/* edit.c */
  883. Xvoid   edit();
  884. Xvoid   insertchar();
  885. Xvoid   getout();
  886. Xvoid   scrollup();
  887. Xvoid   scrolldown();
  888. Xvoid   beginline();
  889. Xbool_t oneright();
  890. Xbool_t oneleft();
  891. Xbool_t oneup();
  892. Xbool_t onedown();
  893. X
  894. X/* fileio.c */
  895. Xvoid   filemess();
  896. Xvoid   renum();
  897. Xbool_t readfile();
  898. Xbool_t writeit();
  899. X
  900. X/* s_io.c */
  901. Xvoid   s_clear();
  902. Xvoid   s_refresh();
  903. Xvoid   NotValidFromCurschar();
  904. Xvoid   Update_Botchar();
  905. X
  906. X/* help.c */
  907. Xbool_t help();
  908. X
  909. X/* inc.c */
  910. Xint    inc();
  911. X
  912. X/* linefunc.c */
  913. XLPtr  *nextline();
  914. XLPtr  *prevline();
  915. Xvoid   coladvance();
  916. X
  917. X/* main.c */
  918. Xvoid   stuffReadbuff();
  919. Xvoid   stuffnumReadbuff();
  920. Xchar   vgetc();
  921. Xchar   vpeekc();
  922. X
  923. X/* mark.c */
  924. Xvoid   setpcmark();
  925. Xvoid   clrall();
  926. Xvoid   clrmark();
  927. Xbool_t setmark();
  928. XLPtr  *getmark();
  929. X
  930. X/* misccmds.c */
  931. Xbool_t OpenForward();
  932. Xbool_t OpenBackward();
  933. Xvoid   fileinfo();
  934. Xvoid   inschar();
  935. Xvoid   insstr();
  936. Xvoid   delline();
  937. Xbool_t delchar();
  938. Xint    cntllines();
  939. Xint    plines();
  940. XLPtr  *gotoline();
  941. X
  942. X/* normal.c */
  943. Xvoid   normal();
  944. Xvoid   ResetBuffers();
  945. Xvoid   AppendToInsbuff();
  946. Xvoid   AppendToRedobuff();
  947. Xvoid   AppendNumberToRedobuff();
  948. Xvoid   AppendToUndobuff();
  949. Xvoid   AppendNumberToUndobuff();
  950. Xvoid   AppendPositionToUndobuff();
  951. Xvoid   AppendToUndoUndobuff();
  952. Xvoid   AppendNumberToUndoUndobuff();
  953. Xvoid   AppendPositionToUndoUndobuff();
  954. Xbool_t linewhite();
  955. X
  956. X/* mk.c */
  957. Xchar  *mkstr();
  958. Xchar  *mkline();
  959. X
  960. X/* param.c */
  961. Xvoid   doset();
  962. X
  963. X/* screen.c */
  964. Xvoid   cursupdate();
  965. X
  966. X/* search.c */
  967. Xvoid   doglob();
  968. Xvoid   dosub();
  969. Xvoid   searchagain();
  970. Xbool_t dosearch();
  971. Xbool_t repsearch();
  972. Xbool_t searchc();
  973. Xbool_t crepsearch();
  974. Xbool_t findfunc();
  975. XLPtr  *showmatch();
  976. XLPtr  *fwd_word();
  977. XLPtr  *bck_word();
  978. XLPtr  *end_word();
  979. X
  980. X/* format_l.c */
  981. Xchar *format_line();
  982. X
  983. X/*
  984. X * Machine-dependent routines. 
  985. X */
  986. X#ifdef AMIGA
  987. X# include "amiga.h"
  988. X#endif
  989. X#ifdef BSD
  990. X# include "bsd.h"
  991. X#endif
  992. X#ifdef UNIX
  993. X# include "unix.h"
  994. X#endif
  995. X#ifdef TOS
  996. X# include "tos.h"
  997. X#endif
  998. X#ifdef OS2
  999. X# include "os2.h"
  1000. X#endif
  1001. X#ifdef DOS
  1002. X# include "dos.h"
  1003. X#endif
  1004. SHAR_EOF
  1005. echo "extracting tags"
  1006. sed 's/^X//' << \SHAR_EOF > tags
  1007. XISSPECIAL    edit.c    /^#define ISSPECIAL(c)    ((c) == BS || (c) == NL ||/
  1008. Xalloc    alloc.c    /^alloc(size)$/
  1009. Xbadcmd    cmdline.c    /^badcmd()$/
  1010. Xbeginline    edit.c    /^beginline(flag)$/
  1011. Xcanincrease    alloc.c    /^canincrease(n)$/
  1012. Xdec    dec.c    /^dec(lp)$/
  1013. Xdoecmd    cmdline.c    /^doecmd(arg)$/
  1014. Xdoshell    cmdline.c    /^doshell()$/
  1015. Xdotag    cmdline.c    /^dotag(tag, force)$/
  1016. Xedit    edit.c    /^edit()$/
  1017. Xemsg    cmdline.c    /^emsg(s)$/
  1018. Xfilealloc    alloc.c    /^filealloc()$/
  1019. Xfreeall    alloc.c    /^freeall()$/
  1020. Xget_line    cmdline.c    /^get_line(cp)$/
  1021. Xget_range    cmdline.c    /^get_range(cp)$/
  1022. Xgetout    edit.c    /^getout(r)$/
  1023. Xgotocmdline    cmdline.c    /^gotocmdline(clr, firstc)$/
  1024. Xinsertchar    edit.c    /^insertchar(c)$/
  1025. Xmsg    cmdline.c    /^msg(s)$/
  1026. Xnewline    alloc.c    /^newline(nchars)$/
  1027. Xonedown    edit.c    /^onedown(n)$/
  1028. Xoneleft    edit.c    /^oneleft()$/
  1029. Xoneright    edit.c    /^oneright()$/
  1030. Xoneup    edit.c    /^oneup(n)$/
  1031. Xreadcmdline    cmdline.c    /^readcmdline(firstc, cmdline)$/
  1032. Xscreenalloc    alloc.c    /^screenalloc()$/
  1033. Xscrolldown    edit.c    /^scrolldown(nlines)$/
  1034. Xscrollup    edit.c    /^scrollup(nlines)$/
  1035. Xsmsg    cmdline.c    /^smsg(s, a1, a2, a3, a4, a5, a6, a7, a8, a9)$/
  1036. Xstrsave    alloc.c    /^strsave(string)$/
  1037. Xwait_return    cmdline.c    /^wait_return()$/
  1038. XMmain    main.c    /^main(argc, argv)$/
  1039. Xclrall    mark.c    /^clrall()$/
  1040. Xclrmark    mark.c    /^clrmark(line)$/
  1041. Xcoladvance    linefunc.c    /^coladvance(p, want_col)$/
  1042. Xfilemess    fileio.c    /^filemess(s)$/
  1043. Xgetmark    mark.c    /^getmark(c)$/
  1044. Xhelp    help.c    /^help()$/
  1045. Xinc    inc.c    /^inc(lp)$/
  1046. Xlongline    help.c    /^longline(p)$/
  1047. Xnextline    linefunc.c    /^nextline(curr)$/
  1048. Xprevline    linefunc.c    /^prevline(curr)$/
  1049. Xreadfile    fileio.c    /^readfile(fname, fromp, nochangename)$/
  1050. Xrenum    fileio.c    /^renum()$/
  1051. Xsetmark    mark.c    /^setmark(c)$/
  1052. Xsetpcmark    mark.c    /^setpcmark()$/
  1053. XstuffReadbuff    main.c    /^stuffReadbuff(s)$/
  1054. XstuffnumReadbuff    main.c    /^stuffnumReadbuff(n)$/
  1055. Xusage    main.c    /^usage()$/
  1056. Xvgetc    main.c    /^vgetc()$/
  1057. Xvpeekc    main.c    /^vpeekc()$/
  1058. Xwriteit    fileio.c    /^writeit(fname, start, end)$/
  1059. XAppendNumberToRedobuff    normal.c    /^AppendNumberToRedobuff(n)$/
  1060. XAppendNumberToUndoUndobuff    normal.c    /^AppendNumberToUndoUndobuff(n)$/
  1061. XAppendNumberToUndobuff    normal.c    /^AppendNumberToUndobuff(n)$/
  1062. XAppendPositionToUndoUndobuff    normal.c    /^AppendPositionToUndoUndobuff(column, row)$/
  1063. XAppendPositionToUndobuff    normal.c    /^AppendPositionToUndobuff(column, row)$/
  1064. XAppendToInsbuff    normal.c    /^AppendToInsbuff(s)$/
  1065. XAppendToRedobuff    normal.c    /^AppendToRedobuff(s)$/
  1066. XAppendToUndoUndobuff    normal.c    /^AppendToUndoUndobuff(s)$/
  1067. XAppendToUndobuff    normal.c    /^AppendToUndobuff(s)$/
  1068. XDEFAULT1    normal.c    /^#define DEFAULT1(x)     (((x) == 0) ? 1 : (x))$/
  1069. XIDCHAR    normal.c    /^#define IDCHAR(c)       (isalpha(c) || isdigit(c) /
  1070. XOpenBackward    misccmds.c    /^OpenBackward(can_ai)$/
  1071. XOpenForward    misccmds.c    /^OpenForward(can_ai)$/
  1072. XResetBuffers    normal.c    /^ResetBuffers()$/
  1073. Xcntllines    misccmds.c    /^cntllines(pbegin, pend)$/
  1074. Xcursupdate    screen.c    /^cursupdate(type)$/
  1075. Xdelchar    misccmds.c    /^delchar(fixpos, undo)$/
  1076. Xdelline    misccmds.c    /^delline(nlines)$/
  1077. Xdochange    normal.c    /^dochange()$/
  1078. Xdodelete    normal.c    /^dodelete(redraw, setup_for_undo, try_to_yank)$/
  1079. Xdojoin    normal.c    /^dojoin(leading_space, strip_leading_spaces)$/
  1080. Xdoput    normal.c    /^doput(dir)$/
  1081. Xdoset    param.c    /^doset(arg, inter)$/
  1082. Xdoshift    normal.c    /^doshift(op)$/
  1083. Xdoyank    normal.c    /^doyank()$/
  1084. Xfileinfo    misccmds.c    /^fileinfo()$/
  1085. Xgotoline    misccmds.c    /^gotoline(n)$/
  1086. Xinschar    misccmds.c    /^inschar(c)$/
  1087. Xinsstr    misccmds.c    /^insstr(s)$/
  1088. Xlinewhite    normal.c    /^linewhite(p)$/
  1089. Xnormal    normal.c    /^normal(c)$/
  1090. Xplines    misccmds.c    /^plines(s)$/
  1091. Xshowparms    param.c    /^showparms(all)$/
  1092. Xstartinsert    normal.c    /^startinsert(startln)$/
  1093. Xtabinout    normal.c    /^tabinout(shift_type, num)$/
  1094. Xupdateline    screen.c    /^updateline()$/
  1095. XC0    search.c    /^#define C0(c)   (((c) == ' ') || ((c) == '\\t') || /
  1096. XC1    search.c    /^#define C1(c)   (isalpha(c) || isdigit(c) || ((c) /
  1097. XOTHERDIR    search.c    /^#define OTHERDIR(x)     (((x) == FORWARD) ? BACKWA/
  1098. Xbck_word    search.c    /^bck_word(p, type)$/
  1099. Xbcksearch    search.c    /^bcksearch(str)$/
  1100. Xcls    search.c    /^cls(c)$/
  1101. Xcrepsearch    search.c    /^crepsearch(flag)$/
  1102. Xdoglob    search.c    /^doglob(lp, up, cmd)$/
  1103. Xdosearch    search.c    /^dosearch(dir, str)$/
  1104. Xdosub    search.c    /^dosub(lp, up, cmd)$/
  1105. Xend_word    search.c    /^end_word(p, type)$/
  1106. Xfindfunc    search.c    /^findfunc(dir)$/
  1107. Xformat_line    format_l.c    /^format_line(ptr, len)$/
  1108. Xfwd_word    search.c    /^fwd_word(p, type)$/
  1109. Xfwdsearch    search.c    /^fwdsearch(str)$/
  1110. Xmapstring    search.c    /^mapstring(s)$/
  1111. Xregerror    search.c    /^regerror(s)$/
  1112. Xrepsearch    search.c    /^repsearch(flag)$/
  1113. Xsearchagain    search.c    /^searchagain(dir)$/
  1114. Xsearchc    search.c    /^searchc(c, dir, type)$/
  1115. Xshowmatch    search.c    /^showmatch()$/
  1116. Xssearch    search.c    /^ssearch(dir, str)$/
  1117. XCTRL    ascii.h    /^#define    CTRL(x)    ((x) & 0x1f)$/
  1118. XNotValidFromCurschar    s_io.c    /^NotValidFromCurschar()$/
  1119. XUpdate_Botchar    s_io.c    /^Update_Botchar()$/
  1120. Xs_clear    s_io.c    /^s_clear()$/
  1121. Xs_refresh    s_io.c    /^s_refresh(type)$/
  1122. Xscreen_del    s_io.c    /^screen_del(row, nlines, total_rows)$/
  1123. Xscreen_ins    s_io.c    /^screen_ins(row, nlines, total_rows)$/
  1124. Xscreen_refresh    s_io.c    /^screen_refresh(type)$/
  1125. XLINE    stevie.h    131
  1126. XLINEOF    stevie.h    /^#define    LINEOF(x)    ((x)->linep->num)$/
  1127. XLPtr    stevie.h    132
  1128. XP    param.h    /^#define    P(n)    (params[n].value)$/
  1129. XRowNumber    macros.h    /^#define RowNumber(p) (UndoInProgress ? 0 : cntllin/
  1130. Xanyinput    macros.h    /^#define anyinput() (Readbuffptr != NULL)$/
  1131. Xbool_t    stevie.h    54
  1132. Xbuf1line    macros.h    /^#define buf1line() (Filemem->linep->next == Fileen/
  1133. Xbufempty    macros.h    /^#define bufempty() (buf1line() && Filemem->linep->/
  1134. Xendofline    macros.h    /^#define endofline(p) \\$/
  1135. Xequal    macros.h    /^#define equal(a, b) (((a)->linep == (b)->linep) &&/
  1136. Xgchar    macros.h    /^#define gchar(lp) ((lp)->linep->s[(lp)->index])$/
  1137. Xgt    macros.h    /^#define gt(a, b) ((LINEOF(a) != LINEOF(b)) \\$/
  1138. Xgtoreq    macros.h    /^#define gtoreq(a, b) ((LINEOF(a) != LINEOF(b)) \\$/
  1139. Xlineempty    macros.h    /^#define lineempty(p) ((p)->linep->s[0] == NUL)$/
  1140. Xlt    macros.h    /^#define lt(a, b) ((LINEOF(a) != LINEOF(b)) \\$/
  1141. Xltoreq    macros.h    /^#define ltoreq(a, b) ((LINEOF(a) != LINEOF(b)) \\$/
  1142. Xmkline    mk.c    /^mkline(n)$/
  1143. Xmkstr    mk.c    /^mkstr(c)$/
  1144. Xpchar    macros.h    /^#define pchar(lp, c) ((lp)->linep->s[(lp)->index] /
  1145. Xpswap    macros.h    /^#define pswap(a, b) { LPtr pswaptmp; pswaptmp = a;/
  1146. Xstartofline    macros.h    /^#define startofline(p) ((p)->index == 0)$/
  1147. XGetCharacter    amiga.c    /^GetCharacter()$/
  1148. XSendPacket    amiga.c    /^SendPacket(pid, action, args, nargs)$/
  1149. Xbeep    amiga.c    /^beep()$/
  1150. Xcooked    amiga.c    /^cooked(afh)$/
  1151. Xdelay    amiga.c    /^delay()$/
  1152. Xflushbuf    amiga.c    /^flushbuf()$/
  1153. Xfopenb    amiga.c    /^fopenb(fname, mode)$/
  1154. XgetCSIsequence    amiga.c    /^getCSIsequence()$/
  1155. Xget_ConUnit    amiga.c    /^get_ConUnit(afh)$/
  1156. Xinchar    amiga.c    /^inchar()$/
  1157. Xoutchar    amiga.c    /^outchar(c)$/
  1158. Xoutstr    amiga.c    /^outstr(s)$/
  1159. Xraw    amiga.c    /^raw(afh)$/
  1160. Xsleep    amiga.c    /^sleep(n)$/
  1161. Xwindexit    amiga.c    /^windexit(r)$/
  1162. Xwindgoto    amiga.c    /^windgoto(r, c)$/
  1163. Xwindinit    amiga.c    /^windinit()$/
  1164. SHAR_EOF
  1165. echo "extracting term.h"
  1166. sed 's/^X//' << \SHAR_EOF > term.h
  1167. X/*
  1168. X * STEVIE - Simply Try this Editor for VI Enthusiasts
  1169. X *
  1170. X * Code Contributions By : Tim Thompson           twitch!tjt
  1171. X *                         Tony Andrews           onecom!wldrdg!tony 
  1172. X *                         G. R. (Fred) Walter    watmath!watcgl!grwalter 
  1173. X */
  1174. X
  1175. X/*
  1176. X * This file contains the machine dependent escape sequences that the editor
  1177. X * needs to perform various operations. Some of the sequences here are
  1178. X * optional. Anything not available should be indicated by a null string.
  1179. X *
  1180. X * Insert/delete line sequences are necessary.
  1181. X */
  1182. X
  1183. X/*
  1184. X * The macro names here correspond (more or less) to the actual ANSI names 
  1185. X */
  1186. X
  1187. X#ifdef    ATARI
  1188. X#define    T_ED    "\033E"        /* erase display (may optionally home cursor) */
  1189. X#define    T_EL    "\033l"        /* erase the entire current line */
  1190. X#define    T_IL    "\033L"        /* insert one line */
  1191. X#define    T_DL    "\033M"        /* delete one line */
  1192. X#define    T_CI    "\033f"        /* invisible cursor (very optional) */
  1193. X#define    T_CV    "\033e"        /* visible cursor (very optional) */
  1194. X#define T_TP    ""        /* plain text */
  1195. X#define T_TI    ""        /* inverse-video text */
  1196. X#endif
  1197. X
  1198. X#ifdef    UNIX
  1199. X/* The UNIX sequences are hard-wired for ansi-like terminals. */
  1200. X#define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  1201. X#define    T_END_D    "\033[J"    /* erase to end of display */
  1202. X#define    T_EL    "\033[2K"    /* erase the entire current line */
  1203. X#define    T_END_L    "\033[K"    /* erase to the end of the current line */
  1204. X#define    T_IL    "\033[L"    /* insert one line */
  1205. X#define    T_DL    "\033[M"    /* delete one line */
  1206. X#define    T_CI    ""        /* invisible cursor (very optional) */
  1207. X#define    T_CV    ""        /* visible cursor (very optional) */
  1208. X#define T_TP    ""        /* plain text */
  1209. X#define T_TI    ""        /* inverse-video text */
  1210. X#endif
  1211. X
  1212. X#ifdef    BSD
  1213. X/* The BSD 4.3 sequences are hard-wired for ansi-like terminals. */
  1214. X#define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  1215. X#define    T_END_D    "\033[J"    /* erase to end of display */
  1216. X#define    T_EL    "\033[2K"    /* erase the entire current line */
  1217. X#define    T_END_L    "\033[K"    /* erase to the end of the current line */
  1218. X#define    T_IL    "\033[L"    /* insert line */
  1219. X#define    T_DL    "\033[M"    /* delete line */
  1220. X#define    T_CI    ""        /* invisible cursor */
  1221. X#define    T_CV    ""        /* visible cursor */
  1222. X#define T_TP    "\033[m"    /* plain text */
  1223. X#define T_TI    "\033[7m"    /* inverse-video text */
  1224. X#endif
  1225. X
  1226. X#ifdef    OS2
  1227. X/*
  1228. X * The OS/2 ansi console driver is pretty deficient. No insert or delete line
  1229. X * sequences. The erase line sequence only erases from the cursor to the end
  1230. X * of the line. For our purposes that works out okay, since the only time
  1231. X * T_EL is used is when the cursor is in column 0.
  1232. X *
  1233. X * The insert/delete line sequences marked here are actually implemented in
  1234. X * the file os2.c using direct OS/2 system calls. This makes the capability
  1235. X * available for the rest of the editor via appropriate escape sequences
  1236. X * passed to outstr().
  1237. X */
  1238. X#define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  1239. X#define    T_EL    "\033[K"    /* erase the entire current line */
  1240. X#define    T_END_L    "\033[K"    /* erase to the end of the current line */
  1241. X#define    T_IL    "\033[L"    /* insert one line - fake (see os2.c) */
  1242. X#define    T_DL    "\033[M"    /* delete one line - fake (see os2.c) */
  1243. X#define    T_CI    ""        /* invisible cursor (very optional) */
  1244. X#define    T_CV    ""        /* visible cursor (very optional) */
  1245. X#define T_TP    ""        /* plain text */
  1246. X#define T_TI    ""        /* inverse-video text */
  1247. X#endif
  1248. X
  1249. X#ifdef AMIGA
  1250. X/*
  1251. X * The erase line sequence only erases from the cursor to the end of the
  1252. X * line. For our purposes that works out okay, since the only time T_EL is
  1253. X * used is when the cursor is in column 0. 
  1254. X */
  1255. X#define    T_ED    "\014"        /* erase display (may optionally home cursor) */
  1256. X#define    T_END_D    "\033[J"    /* erase to end of display */
  1257. X#define    T_EL    "\033[K"    /* erase the entire current line */
  1258. X#define    T_END_L    "\033[K"    /* erase to the end of the current line */
  1259. X#define    T_IL    "\033["        /* insert line */
  1260. X#define    T_IL_B    "L"
  1261. X#define    T_DL    "\033["        /* delete line */
  1262. X#define    T_DL_B    "M"
  1263. X#define    T_CI    "\033[0 p"    /* invisible cursor (very optional) */
  1264. X#define    T_CV    "\033[1 p"    /* visible cursor (very optional) */
  1265. X#define T_TP    "\033[0m"    /* plain text */
  1266. X#define T_TI    "\033[7m"    /* inverse-video text */
  1267. X#endif
  1268. X
  1269. X#ifdef    DOS
  1270. X/*
  1271. X * DOS sequences
  1272. X *
  1273. X * Some of the following sequences require the use of the "nansi.sys"
  1274. X * console driver. The standard "ansi.sys" driver doesn't support
  1275. X * sequences for insert/delete line.
  1276. X */
  1277. X#define    T_ED    "\033[2J"    /* erase display (may optionally home cursor) */
  1278. X#define    T_EL    "\033[K"    /* erase the entire current line */
  1279. X#define    T_IL    "\033[L"    /* insert line (requires nansi.sys driver) */
  1280. X#define    T_DL    "\033[M"    /* delete line (requires nansi.sys driver) */
  1281. X#define    T_CI    ""        /* invisible cursor (very optional) */
  1282. X#define    T_CV    ""        /* visible cursor (very optional) */
  1283. X#define T_TP    ""        /* plain text */
  1284. X#define T_TI    ""        /* inverse-video text */
  1285. X#endif
  1286. SHAR_EOF
  1287. echo "extracting tos.c"
  1288. sed 's/^X//' << \SHAR_EOF > tos.c
  1289. X/*
  1290. X * System-dependent routines for the Atari ST. 
  1291. X */
  1292. X
  1293. X#include "stevie.h"
  1294. X
  1295. X#include <osbind.h>
  1296. X
  1297. X/*
  1298. X * The following buffer is used to work around a bug in TOS. It appears that
  1299. X * unread console input can cause a crash, but only if console output is
  1300. X * going on. The solution is to always grab any unread input before putting
  1301. X * out a character. The following buffer holds any characters read in this
  1302. X * fashion. The problem can be easily produced because STEVIE can't yet keep
  1303. X * up with the normal auto-repeat rate in insert mode. 
  1304. X */
  1305. X#define IBUFSZ  128
  1306. X
  1307. Xstatic long     inbuf[IBUFSZ];    /* buffer for unread input */
  1308. Xstatic long    *inptr = inbuf;    /* where to put next character */
  1309. X
  1310. X/*
  1311. X * inchar() - get a character from the keyboard 
  1312. X *
  1313. X * Certain special keys are mapped to values above 0x80. These mappings are
  1314. X * defined in keymap.h. If the key has a non-zero ascii value, it is simply
  1315. X * returned. Otherwise it may be a special key we want to map. 
  1316. X *
  1317. X * The ST has a bug involving keyboard input that seems to occur when typing
  1318. X * quickly, especially typing capital letters. Sometimes a value of
  1319. X * 0x02540000 is read. This doesn't correspond to anything on the keyboard,
  1320. X * according to my documentation. My solution is to loop when any unknown key
  1321. X * is seen. Normally, the bell is rung to indicate the error. If the "bug"
  1322. X * value is seen, we ignore it completely. 
  1323. X */
  1324. Xint
  1325. Xinchar()
  1326. X{
  1327. X    for (;;) {
  1328. X    long            c, *p;
  1329. X
  1330. X    /*
  1331. X     * Get the next input character, either from the input buffer or
  1332. X     * directly from TOS. 
  1333. X     */
  1334. X    if (inptr != inbuf) {    /* input in the buffer, use it */
  1335. X        c = inbuf[0];
  1336. X        /*
  1337. X         * Shift everything else in the buffer down. This would be
  1338. X         * cleaner if we used a circular buffer, but it really isn't
  1339. X         * worth it. 
  1340. X         */
  1341. X        inptr--;
  1342. X        for (p = inbuf; p < inptr; p++)
  1343. X        *p = *(p + 1);
  1344. X    } else
  1345. X        c = Crawcin();
  1346. X
  1347. X    if ((c & 0xff) != 0)
  1348. X        return ((int) c);
  1349. X
  1350. X    switch ((int) (c >> 16) & 0xff) {
  1351. X
  1352. X      case 0x62:
  1353. X        return K_HELP;
  1354. X      case 0x61:
  1355. X        return K_UNDO;
  1356. X      case 0x52:
  1357. X        return K_INSERT;
  1358. X      case 0x47:
  1359. X        return K_HOME;
  1360. X      case 0x48:
  1361. X        return K_UARROW;
  1362. X      case 0x50:
  1363. X        return K_DARROW;
  1364. X      case 0x4b:
  1365. X        return K_LARROW;
  1366. X      case 0x4d:
  1367. X        return K_RARROW;
  1368. X      case 0x29:
  1369. X        return K_CGRAVE;    /* control grave accent */
  1370. X        /*
  1371. X         * Occurs due to a bug in TOS. 
  1372. X         */
  1373. X      case 0x54:
  1374. X        break;
  1375. X        /*
  1376. X         * Add the function keys here later if we put in support for
  1377. X         * macros. 
  1378. X         */
  1379. X      default:
  1380. X        beep();
  1381. X        break;
  1382. X    }
  1383. X    }
  1384. X}
  1385. X/*
  1386. X * get_inchars - snarf away any pending console input 
  1387. X *
  1388. X * If the buffer overflows, we discard what's left and ring the bell. 
  1389. X */
  1390. Xstatic void
  1391. Xget_inchars()
  1392. X{
  1393. X    while (Cconis()) {
  1394. X    if (inptr >= &inbuf[IBUFSZ]) {    /* no room in buffer? */
  1395. X        Crawcin();        /* discard the input */
  1396. X        beep();        /* and sound the alarm */
  1397. X    } else
  1398. X        *inptr++ = Crawcin();
  1399. X    }
  1400. X}
  1401. X
  1402. Xvoid
  1403. Xoutchar(c)
  1404. X    char            c;
  1405. X{
  1406. X    get_inchars();
  1407. X    Cconout(c);
  1408. X}
  1409. X
  1410. Xvoid
  1411. Xoutstr(s)
  1412. X    char           *s;
  1413. X{
  1414. X    get_inchars();
  1415. X    Cconws(s);
  1416. X}
  1417. X
  1418. X#define BGND    0
  1419. X#define TEXT    3
  1420. X
  1421. X/*
  1422. X * vbeep() - visual bell 
  1423. X */
  1424. Xstatic void
  1425. Xvbeep()
  1426. X{
  1427. X    int             text, bgnd;    /* text and background colors */
  1428. X    long            l;
  1429. X
  1430. X    text = Setcolor(TEXT, -1);
  1431. X    bgnd = Setcolor(BGND, -1);
  1432. X
  1433. X    Setcolor(TEXT, bgnd);    /* swap colors */
  1434. X    Setcolor(BGND, text);
  1435. X
  1436. X    for (l = 0; l < 5000; l++);    /* short pause */
  1437. X
  1438. X    Setcolor(TEXT, text);    /* restore colors */
  1439. X    Setcolor(BGND, bgnd);
  1440. X}
  1441. X
  1442. Xvoid
  1443. Xbeep()
  1444. X{
  1445. X    if (RedrawingDisabled)
  1446. X    return;
  1447. X
  1448. X    if (P(P_VB))
  1449. X    vbeep();
  1450. X    else
  1451. X    outchar('\007');
  1452. X}
  1453. X
  1454. X/*
  1455. X * remove(file) - remove a file 
  1456. X */
  1457. Xvoid
  1458. Xremove(file)
  1459. X    char           *file;
  1460. X{
  1461. X    Fdelete(file);
  1462. X}
  1463. X
  1464. X/*
  1465. X * rename(of, nf) - rename existing file 'of' to 'nf' 
  1466. X */
  1467. Xvoid
  1468. Xrename(of, nf)
  1469. X    char           *of, *nf;
  1470. X{
  1471. X    Fdelete(nf);        /* if 'nf' exists, remove it */
  1472. X    Frename(0, of, nf);
  1473. X}
  1474. X
  1475. Xvoid
  1476. Xwindinit()
  1477. X{
  1478. X    if (Getrez() == 0)
  1479. X    Columns = 40;        /* low resolution */
  1480. X    else
  1481. X    Columns = 80;        /* medium or high */
  1482. X
  1483. X    P(P_LI) = Rows = 25;
  1484. X
  1485. X    Cursconf(1, NULL);
  1486. X}
  1487. X
  1488. Xvoid
  1489. Xwindexit(r)
  1490. X    int             r;
  1491. X{
  1492. X    exit(r);
  1493. X}
  1494. X
  1495. Xvoid
  1496. Xwindgoto(r, c)
  1497. X    int             r, c;
  1498. X{
  1499. X    outstr("\033Y");
  1500. X    outchar(r + 040);
  1501. X    outchar(c + 040);
  1502. X}
  1503. X
  1504. X#ifndef MWC
  1505. X/*
  1506. X * System calls or library routines missing in TOS. 
  1507. X */
  1508. X
  1509. Xvoid
  1510. Xsleep(n)
  1511. X    int             n;
  1512. X{
  1513. X    int             k;
  1514. X
  1515. X    k = Tgettime();
  1516. X    while (Tgettime() <= k + n);
  1517. X}
  1518. X#endif
  1519. X
  1520. Xvoid
  1521. Xdelay()
  1522. X{
  1523. X    long            n;
  1524. X
  1525. X    for (n = 0; n < 8000; n++);
  1526. X}
  1527. X
  1528. X#ifndef MWC
  1529. Xint
  1530. Xsystem(cmd)
  1531. X    char           *cmd;
  1532. X{
  1533. X    char            arg[1];
  1534. X
  1535. X    arg[0] = (char) 0;        /* no arguments passed to the shell */
  1536. X
  1537. X    if (Pexec(0, cmd, arg, 0L) < 0)
  1538. X    return -1;
  1539. X    else
  1540. X    return 0;
  1541. X}
  1542. X#endif
  1543. X
  1544. X#ifdef  MEGAMAX
  1545. Xchar           *
  1546. Xstrchr(s, c)
  1547. X    char           *s;
  1548. X    int             c;
  1549. X{
  1550. X    do {
  1551. X    if (*s == c)
  1552. X        return (s);
  1553. X    } while (*s++);
  1554. X    return (NULL);
  1555. X}
  1556. X#endif
  1557. X
  1558. X#ifdef  FOPENB
  1559. X
  1560. XFILE           *
  1561. Xfopenb(fname, mode)
  1562. X    char           *fname;
  1563. X    char           *mode;
  1564. X{
  1565. X    char            modestr[10];
  1566. X
  1567. X    sprintf(modestr, "b%s", mode);
  1568. X
  1569. X    return fopen(fname, modestr);
  1570. X}
  1571. X
  1572. X#endif
  1573. X
  1574. X#ifndef MWC
  1575. X/*
  1576. X * getenv() - get a string from the environment 
  1577. X *
  1578. X * Both Alcyon and Megamax are missing getenv(). This routine works for both
  1579. X * compilers and with the Beckemeyer and Gulam shells. With gulam, the
  1580. X * env_style variable should be set to either "mw" or "gu". 
  1581. X */
  1582. Xchar           *
  1583. Xgetenv(name)
  1584. X    char           *name;
  1585. X{
  1586. X    extern long     _base;
  1587. X    char           *envp, *p;
  1588. X
  1589. X    envp = *((char **) (_base + 0x2c));
  1590. X
  1591. X    for (; *envp; envp += strlen(envp) + 1) {
  1592. X    if (strncmp(envp, name, strlen(name)) == 0) {
  1593. X        p = envp + strlen(name);
  1594. X        if (*p++ == '=')
  1595. X        return p;
  1596. X    }
  1597. X    }
  1598. X    return (char *) 0;
  1599. X}
  1600. X#endif
  1601. SHAR_EOF
  1602. echo "extracting tos.h"
  1603. sed 's/^X//' << \SHAR_EOF > tos.h
  1604. X/*
  1605. X * Atari Machine-dependent routines. 
  1606. X */
  1607. X
  1608. Xint  inchar();
  1609. Xvoid outchar();
  1610. Xvoid outstr(), beep();
  1611. Xvoid remove(), rename();
  1612. Xvoid windinit(), windexit(), windgoto();
  1613. Xvoid delay();
  1614. Xvoid sleep();
  1615. SHAR_EOF
  1616. echo "extracting unix.c"
  1617. sed 's/^X//' << \SHAR_EOF > unix.c
  1618. X/*
  1619. X * System-dependent routines for UNIX System V Release 3. 
  1620. X */
  1621. X
  1622. X#include "stevie.h"
  1623. X/* #include <termio.h> /* System V */
  1624. X#include <curses.h>        /* BSD */
  1625. X
  1626. X/*
  1627. X * inchar() - get a character from the keyboard 
  1628. X */
  1629. Xint
  1630. Xinchar()
  1631. X{
  1632. X    char            c;
  1633. X
  1634. X    flushbuf();            /* flush any pending output */
  1635. X
  1636. X    while (read(0, &c, 1) != 1);
  1637. X
  1638. X    return (int) c;
  1639. X}
  1640. X
  1641. X#define BSIZE   2048
  1642. Xstatic char     outbuf[BSIZE];
  1643. Xstatic int      bpos = 0;
  1644. X
  1645. Xflushbuf()
  1646. X{
  1647. X    if (bpos != 0)
  1648. X    write(1, outbuf, bpos);
  1649. X    bpos = 0;
  1650. X}
  1651. X
  1652. X/*
  1653. X * Macro to output a character. Used within this file for speed. 
  1654. X */
  1655. X#define outone(c)       outbuf[bpos++] = c; if (bpos >= BSIZE) flushbuf()
  1656. X
  1657. X/*
  1658. X * Function version for use outside this file. 
  1659. X */
  1660. Xvoid
  1661. Xoutchar(c)
  1662. X    char            c;
  1663. X{
  1664. X    outbuf[bpos++] = c;
  1665. X    if (bpos >= BSIZE)
  1666. X    flushbuf();
  1667. X}
  1668. X
  1669. Xvoid
  1670. Xoutstr(s)
  1671. X    char           *s;
  1672. X{
  1673. X    while (*s) {
  1674. X    outone(*s++);
  1675. X    }
  1676. X}
  1677. X
  1678. Xvoid
  1679. Xbeep()
  1680. X{
  1681. X    if (RedrawingDisabled)
  1682. X    return;
  1683. X
  1684. X    outone('\007');
  1685. X}
  1686. X
  1687. X/*
  1688. X * remove(file) - remove a file 
  1689. X */
  1690. Xvoid
  1691. Xremove(file)
  1692. X    char           *file;
  1693. X{
  1694. X    unlink(file);
  1695. X}
  1696. X
  1697. X/*
  1698. X * rename(of, nf) - rename existing file 'of' to 'nf' 
  1699. X */
  1700. Xvoid
  1701. Xrename(of, nf)
  1702. X    char           *of, *nf;
  1703. X{
  1704. X    unlink(nf);
  1705. X    link(of, nf);
  1706. X    unlink(of);
  1707. X}
  1708. X
  1709. Xvoid
  1710. Xdelay()
  1711. X{
  1712. X    /* not implemented */
  1713. X}
  1714. X
  1715. Xstatic struct termio ostate;
  1716. X
  1717. Xvoid
  1718. Xwindinit()
  1719. X{
  1720. X    char           *getenv();
  1721. X    char           *term;
  1722. X    struct termio   nstate;
  1723. X
  1724. X    if ((term = getenv("TERM")) == NULL || strcmp(term, "vt100") != 0) {
  1725. X    fprintf(stderr, "Invalid terminal type '%s'\n", term);
  1726. X    exit(1);
  1727. X    }
  1728. X    Columns = 80;
  1729. X    P(P_LI) = Rows = 24;
  1730. X
  1731. X    /*
  1732. X     * Go into cbreak mode 
  1733. X     */
  1734. X    ioctl(0, TCGETA, &ostate);
  1735. X    nstate = ostate;
  1736. X    nstate.c_lflag &= ~(ICANON | ECHO | ECHOE | ECHOK | ECHONL);
  1737. X    nstate.c_cc[VMIN] = 1;
  1738. X    nstate.c_cc[VTIME] = 0;
  1739. X    ioctl(0, TCSETAW, &nstate);
  1740. X}
  1741. X
  1742. Xvoid
  1743. Xwindexit(r)
  1744. X    int             r;
  1745. X{
  1746. X    /*
  1747. X     * Restore terminal modes 
  1748. X     */
  1749. X    ioctl(0, TCSETAW, &ostate);
  1750. X
  1751. X    exit(r);
  1752. X}
  1753. X
  1754. X#define outone(c)       outbuf[bpos++] = c; if (bpos >= BSIZE) flushbuf()
  1755. X
  1756. Xvoid
  1757. Xwindgoto(r, c)
  1758. X    int             r, c;
  1759. X{
  1760. X    r += 1;
  1761. X    c += 1;
  1762. X
  1763. X    /*
  1764. X     * Check for overflow once, to save time. 
  1765. X     */
  1766. X    if (bpos + 8 >= BSIZE)
  1767. X    flushbuf();
  1768. X
  1769. X    outbuf[bpos++] = '\033';
  1770. X    outbuf[bpos++] = '[';
  1771. X    if (r >= 10)
  1772. X    outbuf[bpos++] = r / 10 + '0';
  1773. X    outbuf[bpos++] = r % 10 + '0';
  1774. X    outbuf[bpos++] = ';';
  1775. X    if (c >= 10)
  1776. X    outbuf[bpos++] = c / 10 + '0';
  1777. X    outbuf[bpos++] = c % 10 + '0';
  1778. X    outbuf[bpos++] = 'H';
  1779. X}
  1780. X
  1781. XFILE           *
  1782. Xfopenb(fname, mode)
  1783. X    char           *fname;
  1784. X    char           *mode;
  1785. X{
  1786. X    return fopen(fname, mode);
  1787. X}
  1788. SHAR_EOF
  1789. echo "extracting unix.h"
  1790. sed 's/^X//' << \SHAR_EOF > unix.h
  1791. X/*
  1792. X * Unix Machine-dependent routines. 
  1793. X */
  1794. X
  1795. Xint  inchar();
  1796. Xvoid outchar();
  1797. Xvoid outstr(), beep();
  1798. Xvoid remove(), rename();
  1799. Xvoid windinit(), windexit(), windgoto();
  1800. Xvoid delay();
  1801. SHAR_EOF
  1802. echo "extracting version.c"
  1803. sed 's/^X//' << \SHAR_EOF > version.c
  1804. X/*
  1805. X * STEVIE - Simply Try this Editor for VI Enthusiasts
  1806. X *
  1807. X * Code Contributions By : Tim Thompson           twitch!tjt
  1808. X *                         Tony Andrews           onecom!wldrdg!tony 
  1809. X *                         G. R. (Fred) Walter    watmath!watcgl!grwalter 
  1810. X */
  1811. X
  1812. X/*
  1813. X * Version  Changes (and person who did them)
  1814. X * -------  ---------------------------------
  1815. X * 3.10     - version that started it all. Found on comp.sources.unix
  1816. X *            Jun88 Volume 15 i037, i038, i039, i040, i042, and INF3
  1817. X *          - Tim Thompson and Tony Andrews
  1818. X * 
  1819. X * 3.10A    - took version of STEVIE posted to usenet and added Amiga
  1820. X *            and BSD support; added undo and redo commands; sped up
  1821. X *            output to screen; sped up on-screen activities (such as
  1822. X *            cursoring); fixed miscellaneous small bugs and changed some
  1823. X *            commands so that they more closely resembled vi.
  1824. X *          - GRWalter (Fred)
  1825. X * 
  1826. X * 3.11B    - added the ability to be run in the background (STEVIE will
  1827. X *            attempt to use the current window, but if it can't then it
  1828. X *            will open its own window). Fixed some other miscellaneous
  1829. X *            bugs (some to do with re-sizing the screen, one to do with
  1830. X *            undo'ing changes on lines that start with whitespace).
  1831. X *          - GRWalter (Fred)
  1832. X * 
  1833. X * 3.11C    - fixed a bug that was causing the entire screen to be refreshed
  1834. X *            at the wrong times sometimes. Input mode was sped up as well
  1835. X *            as a bug involving lines that wrapped was fixed. Changed :ta
  1836. X *            a bit. Fixed bug triggered when files are > 6000 lines.
  1837. X *          - GRWalter (Fred)
  1838. X *
  1839. X * 3.31A    - Tony Andrews put out a divergent version of STEVIE (version 3.31).
  1840. X *            I moved the important stuff over into my version.
  1841. X *
  1842. X *            Here is a list of what was moved over :
  1843. X * 
  1844. X *************************************************************************
  1845. X * Revision 3.29  88/06/26  14:53:19  tony
  1846. X * Added support for a simple form of the "global" command. It supports
  1847. X * commands of the form "g/pat/d" or "g/pat/p", to delete or print lines
  1848. X * that match the given pattern. A range spec may be used to limit the
  1849. X * lines to be searched.
  1850. X * 
  1851. X * Revision 3.28  88/06/25  21:44:22  tony
  1852. X * Fixed a problem in the processing of colon commands that caused
  1853. X * substitutions of patterns containing white space to fail.
  1854. X * 
  1855. X * Revision 3.26  88/06/10  13:44:06  tony
  1856. X * Fixed a bug involving writing out files with long pathnames. A small
  1857. X * fixed size buffer was being used. The space for the backup file name
  1858. X * is now allocated dynamically.
  1859. X * 
  1860. X * Revision 1.12  88/05/03  14:39:52  tony
  1861. X * Also merged in support for DOS.
  1862. X * 
  1863. X * Revision 1.11  88/05/02  21:38:21  tony
  1864. X * The code that reads files now handles boundary/error conditions much
  1865. X * better, and generates status/error messages that are compatible with
  1866. X * the real vi. Also fixed a bug in repeated reverse searches that got
  1867. X * inserted in the recent changes to search.c.
  1868. X * 
  1869. X * Revision 1.10  88/05/02  07:35:41  tony
  1870. X * Fixed a bug in the routine plines() that was introduced during changes
  1871. X * made for the last version.
  1872. X * 
  1873. X * Revision 1.9  88/05/01  20:10:19  tony
  1874. X * Fixed some problems with auto-indent, and added support for the "number"
  1875. X * parameter.
  1876. X * 
  1877. X * Revision 1.8  88/04/30  20:00:49  tony
  1878. X * Added support for the auto-indent feature.
  1879. X * 
  1880. X * Revision 1.6  88/04/28  08:19:35  tony
  1881. X * Modified Henry Spencer's regular expression library to support new
  1882. X * features that couldn't be done easily with the existing interface.
  1883. X * This code is now a direct part of the editor source code. The editor
  1884. X * now supports the "ignorecase" parameter, and multiple substitutions
  1885. X * per line, as in "1,$s/foo/bar/g".
  1886. X * 
  1887. X * Revision 1.5  88/04/24  21:38:00  tony
  1888. X * Added preliminary support for the substitute command. Full range specs.
  1889. X * are supported, but only a single substitution is allowed on each line.
  1890. X * 
  1891. X * Revision 1.4  88/04/23  20:41:01  tony
  1892. X * Worked around a problem with adding lines to the end of the buffer when
  1893. X * the cursor is at the bottom of the screen (in misccmds.c). Also fixed a
  1894. X * bug that caused reverse searches from the start of the file to bomb.
  1895. X * 
  1896. X * Revision 1.3  88/03/24  08:57:00  tony
  1897. X * Fixed a bug in cmdline() that had to do with backspacing out of colon
  1898. X * commands or searches. Searches were okay, but colon commands backed out
  1899. X * one backspace too early.
  1900. X * 
  1901. X * Revision 1.2  88/03/21  16:47:55  tony
  1902. X * Fixed a bug in renum() causing problems with large files (>6400 lines).
  1903. X *************************************************************************
  1904. X *          - GRWalter (Fred)
  1905. X *
  1906. X * 3.32A    - added the :[range]d command. Played with 'p' and 'P'.
  1907. X *            Added undo capability to :s and :g//d commands.
  1908. X *            Added '%' as a line range specifier (entire file).
  1909. X *            Fixed search so that tags file from real ctags could be used.
  1910. X *            Fixed undo after delete everything operation.
  1911. X *            Made prt_line work in nu mode (so :g//p works right).
  1912. X *            Fixed ai mode (when there was text after the cursor it didn't ai).
  1913. X *            Fixed 'J' (didn't handle next line just having whitespace).
  1914. X *            Fixed :[range] so it behaves like the real vi (goes to highest
  1915. X *            line number in the given range).
  1916. X *            Made it so that the cursor is on the last char inserted instead
  1917. X *            the one right after when there is exactly 1 char right after.
  1918. X *            Made change operator work properly when it ended on the
  1919. X *            end of the line.
  1920. X *          - GRWalter (Fred)
  1921. X *
  1922. X * 3.33A    - no longer s_refresh when putting or undoing or
  1923. X *            redoing until I am done. 'p', 'u' and '.' thus sped up.
  1924. X *          - no longer recalculate line lengths when cursupdate() called,
  1925. X *            which speeds up lots'a things (like on-screen cursoring).
  1926. X *          - avoid redrawing (in s_refresh) as much as possible, which
  1927. X *            speeds up (among other things) cursoring (off screen), put, undo,
  1928. X *            redo, etc.
  1929. X *          - GRWalter (Fred)
  1930. X *
  1931. X * 3.34A    - rewrote s_refresh and updatenextline so they won't do as
  1932. X *            much work. Sped up cursoring off-screen. Fixed bug in cursupdate
  1933. X *            (could index through NULL pointer).
  1934. X *          - GRWalter (Fred)
  1935. X *
  1936. X * 3.35A    - Compiles with Lattice 5.0 now - needed miscellaneous changes.
  1937. X *          - Environment variables (EXINIT) finally used.
  1938. X *          - Stevie is now compiled so it's residentable.
  1939. X *          - Fixed bug in insstr() (caused problems with redo of inserts).
  1940. X *          - Fixed buffer overflow/corrupt messages.
  1941. X *          - Tweaked s_refresh routine some more.
  1942. X *          - Added __DATE__ and __TIME__ of compilation to help screen.
  1943. X *          - GRWalter (Fred)
  1944. X *
  1945. X * 3.35F    - Removed Nextscreen, Realscreen, updateRealscreen and
  1946. X *          - redrawline. Re-wrote all screen I/O to directly update the
  1947. X *          - screen when necessary, with a resulting memory and speed savings.
  1948. X *          - Fixed bug in amiga.c that caused Stevie to (occasionlly) lock-up
  1949. X *            upon startup until the window was resized.
  1950. X *          - Removed T_SC and T_RC from term.h file (no longer used).
  1951. X *          - Miscellaneous little changes.
  1952. X *          - GRWalter (Fred)
  1953. X *
  1954. X * 3.35H    - Fixed all routines to check memory allocation return status
  1955. X *            (except for strsave() function).
  1956. X *          - Fixed bug with macro outone() in amiga.c and bsd.c.
  1957. X *          - GRWalter (Fred)
  1958. X *
  1959. X * 3.6      - Big jump in revision number to do last version on a Fish Disk
  1960. X *            being descibed as version 3.5 (thus people will know this is
  1961. X *            a later version).
  1962. X *          - Miscellaneous little changes.
  1963. X *          - GRWalter (Fred)
  1964. X */
  1965. X
  1966. Xchar           *Version = "STEVIE - Version 3.6";
  1967. SHAR_EOF
  1968. echo "End of archive 6 (of 6)"
  1969. # if you want to concatenate archives, remove anything after this line
  1970. exit
  1971.